\b0 runs the named command on each argument arg in turn. Normally arguments are chosen singly; the optional number n specifies the number of arguments to be passed to command. If n is zero, command is run without arguments once for each arg. Character sequences of the form %d in command, where d is a digit from 1 to 9, are replaced by the d'th following unused arg. If any such sequences occur, n is ignored, and the number of arguments passed to command is the maximum value of d in command. The character `%' may be changed by the -a option.\
Examples:\
\b apply echo * is similar to ls(1);\
apply -2 cmp a1 b1 a2 b2 ... compares the `a' files to the `b' files;\
apply -0 who 1 2 3 4 5 runs who(1) 5 times\
apply 'ln %1 /usr/joe' * links all files in the current directory to the directory /usr/joe.
CommandOption
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 The character `%' may be changed by this option
CommandArgument
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The character to change to
command
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The command to execute
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The arguments for the command
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 The arguments are taken as an expression. After evaluation, the result is written on the standard output. Each token of the expression is a separate argument.\
The operators and keywords are listed below. The list is in order of increasing precedence, with equal precedence operators grouped.\
expr | expr yields the first expr if it is neither null nor `0', otherwise yields the second expr.\
expr & expr yields the first expr if neither expr is null or `0', otherwise yields `0'.\
expr relop expr where relop is one of < <= = != >= >, yields `1' if the indicated comparison is true, `0' if false. The comparison is numeric if both expr are integers, otherwise lexicographic.\
expr + expr expr expr addition or subtraction of the arguments.\
expr * expr expr / expr expr % expr multiplication, division, or remainder of the arguments.\
expr : expr match expr expr compares the first argument (a string) with the second argument (a regular expression); regular expression syntax is the same as that of ed(1). The \\(...\\) pattern symbols can be used to select a portion of the first argument. Otherwise, this operator yields the number of characters matched (`0' on failure).\
index expr expr finds the second argument (a string) in the first. Returns the location of the first matched character (where the first character is at location `1') or `0' if the second argument is not a substring of the first.\
substr expr expr expr returns the substring of the first argument (a string) that starts at the position specified by the second argument (where `1' refers to the first character) and has length equal to the third argument (a numeral).\
length expr returns the length of the argument (a string).\
( expr ) parentheses for grouping.\
Examples:\
To add 1 to the shell variable a:\
\b a=`expr $a + 1`
\b0 \
To find the filename part (least significant part) of the pathname stored in variable a, which may or may not contain `/':\
\b expr $a : '.*/\\(.*\\)' '|' $a
\b0 \
Note the quoted shell metacharacters.
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The arguments to evaluate
\b0 is invoked inside UNIX as the last step in the boot procedure. It normally then runs the automatic reboot sequence as described in reboot(8), and if this succeeds, begins multi-user operation. If the reboot fails, it commences single user operation by giving the super-user a shell on the console. It is possible to pass parameters from the boot program to init so that single user operation is commenced immediately. When such single user operation is terminated by killing the single-user shell (i.e. by hitting ^D), init runs /etc/rc without the reboot parameter. This command file performs housekeeping operations such as removing temporary files, mounting file systems, and starting daemons. In multi-user operation, init's role is to create a process for each terminal port on which a user may log in. To begin such operations, it reads the file /etc/ttys and executes a command for each terminal specified in the file. This command will usually be /usr/etc/getty. Getty opens and initializes the terminal line, reads the user's name and invokes login to log in the user and execute the Shell. Ultimately the Shell will terminate because of an end-offile either typed explicitly or generated as a result of hanging up. The main path of init, which has been waiting for such an event, wakes up and removes the appropriate entry from the file utmp, which records current users, and makes an entry in /usr/adm/wtmp, which maintains a history of logins and logouts. The wtmp entry is made only if a user logged in successfully on the line. Then the appropriate terminal is reopened and getty is reinvoked. Init catches the hangup signal (signal SIGHUP) and interprets it to mean that the file /etc/ttys should be read again. The Shell process on each line which used to be active in ttys but is no longer there is terminated; a new process is created for each added line; lines unchanged in the file are undisturbed. Thus it is possible to drop or add terminal lines without rebooting the system by changing the ttys file and sending a hangup signal to the init process: use `kill -HUP 1.' Init will terminate multi-user operations and resume single-user mode if sent a terminate (TERM) signal, i.e. ``kill -TERM 1''. If there are processes outstanding which are deadlocked (due to hardware or software failure), init will not wait for them all to die (which might take forever), but will time out after 30 seconds and print a warning message. Init will cease creating new getty's and allow the system to slowly die away, if it is sent a terminal stop (TSTP) signal, i.e. ``kill -TSTP 1''. A later hangup will resume full multi-user operations, or a terminate will initiate a single user shell. This hook is used by reboot(8) and halt(8). Init's role is so critical that if it dies, the system will reboot itself automatically. If, at bootstrap time, the init process cannot be located, the system will loop in user mode at location 0x13.
\b0 iteratively reports the number of characters read and written to terminals per second, and, for each disk, the number of transfers per second, kilobytes transferred per second, and the milliseconds per average seek. It also gives the percentage of time the system has spent in user mode, in user mode running low priority (niced) processes, in system mode, and idling.\
To compute this information, for each disk, seeks and data transfer completions and number of words transferred are counted; for terminals collectively, the number of input and output characters are counted. Also, each sixtieth of a second, the state of each disk is examined and a tally is made if the disk is active. From these numbers and given the transfer rates of the devices it is possible to determine average seek times for each device.\
The optional interval argument causes iostat to report once each interval seconds. The first report is for all time since a reboot and each subsequent report is for the last interval only.\
The optional count argument restricts the number of reports.\
If more than 4 disk drives are configured in the system, iostat displays only the first 4 drives. To force iostat to display specific drives, their names may be supplied on the command line.
drives
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The drives to test
interval
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The interval in seconds between reports
count
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 Restricts the number of reports to count
\b0 sends the TERM (terminate, 15) signal to the specified processes. If a signal name or number preceded by `-' is given as first argument, that signal is sent instead of terminate (see sigvec(2)).\
The terminate signal will kill processes that do not catch the signal; `kill -KILL ...' is a sure kill, as the KILL (9) signal cannot be caught. By convention, if process number 0 is specified, all members in the process group (i.e. processes resulting from the current login) are signaled. (But beware: this works only if you use sh(1); not if you use csh(1).) Negative process numbers also have special meanings; see kill(2) for details.\
The killed processes must belong to the current user unless he is the super-user.\
The process number of an asynchronous process started with `&' is reported by the shell. Process numbers can also be found by using ps(1). Kill is a built-in to csh(1); it allows job specifiers of the form ``%...'' as arguments so process id's are not as often used as kill arguments. See csh(1) for details.
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Signal is sent instead of terminate
signal
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 The signal to send
processid
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The process id(s) to send a signal to
\b0 sends the TERM (terminate, 15) signal to the specified processes.\
The terminate signal will kill processes that do not catch the signal; `kill -KILL ...' is a sure kill, as the KILL (9) signal cannot be caught. By convention, if process number 0 is specified, all members in the process group (i.e. processes resulting from the current login) are signaled. (But beware: this works only if you use sh(1); not if you use csh(1).) Negative process numbers also have special meanings; see kill(2) for details.\
The killed processes must belong to the current user unless he is the super-user.\
The process number of an asynchronous process started with `&' is reported by the shell. Process numbers can also be found by using ps(1). Kill is a built-in to csh(1); it allows job specifiers of the form ``%...'' as arguments so process id's are not as often used as kill arguments. See csh(1) for details.
\b0 is a tool used when profiling the operating system. When no arguments are supplied, kgmon indicates the state of operating system profiling as running, off, or not configured. (see config(8)) If the -p flag is specified, kgmon extracts profile data from the operating system and produces a gmon.out file suitable for later analysis by gprof(1).\
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0\cf0 If neither -b nor -h is specified, the state of profiling collection remains unchanged. For example, if the -p flag is specified and profile data is being collected, profiling will be momentarily suspended, the operating system profile buffers will be dumped, and profiling will be immediately resumed.\
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Resume the collection of profile data
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Stop the collection of profile data
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Dump the contents of the profile buffers into a gmon.out file
#{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Reset all the profile buffers. If the -p flag is also specified, the gmon.out file is generated before the buffers are reset
system
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The system to profile
memory
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The memory to profile
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b\i0\ulnone\fs24\fc0\cf0 last
\b0 will look back in the wtmp file which records all logins and logouts for information about a user, a teletype or any group of users and teletypes. Arguments specify names of users or teletypes of interest. Names of teletypes may be given fully or abbreviated. For example `last 0' is the same as `last tty0'. If multiple arguments are given, the information which applies to any of the arguments is printed. For example `last root console' would list all of "root's" sessions as well as all sessions on the console terminal. Last will print the sessions of the specified users and teletypes, most recent first, indicating the times at which the session began, the duration of the session, and the teletype which the session took place on. If the session is still continuing or was cut short by a reboot, last so indicates.\
The pseudo-user reboot logs in at reboots of the system, thus\
\b last reboot
\b0 \
will give an indication of mean time between reboot.\
\b last
\b0 with no arguments prints a record of all logins and logouts, in reverse order. The -N option limits the report to N lines.\
\b last
\b0 is interrupted, it indicates how far the search has progressed in wtmp. If interrupted with a quit signal (generated by a control-\\) last indicates how far the search has progressed so far, and the search continues.
\b0 gives information on previously executed commands. With no arguments, lastcomm prints information about all the commands recorded during the current accounting file's lifetime. If called with arguments, only accounting entries with a matching command name, user name, or terminal name are printed. So, for example, lastcomm a.out root ttyd0 would produce a listing of all the executions of commands named a.out by user root on the terminal ttyd0. For each process entry, the following are printed. The name of the user who ran the process. Flags, as accumulated by the accounting facilities in the system. The command name under which the process was called. The amount of cpu time used by the process (in seconds). The time the process exited. The flags are encoded as follows: ``S'' indicates the command was executed by the super-user, ``F'' indicates the command ran after a fork, but without a following exec, ``D'' indicates the command terminated with the generation of a core file, and ``X'' indicates the command was terminated with a signal.
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The command that was previously executed
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The user that ran the previously executed command
terminal
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The terminal on which the command was previously executed
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Mark every line in the log with the specified tag
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The tag to mark every line with
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Enter the message with the specified priority. The priority may be specified numerically or as a ``facility.level'' pair. For example, ``-p local3.info'' logs the message(s) as informational level in the local3 facility. The default is ``user.notice.''
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The message priority
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Log the process id of the logger process with each line
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Log the specified file
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The file to log
message
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The message to be logged
\f0\b0\i0\ulnone\ql\fs24\fi0\li0\gray0\fc0\cf0\up0\dn0 The
\b on
\b0 program is used to execute commands on another system, in an environment similar to that invoking the program. All environment variables are passed, and the current working directory is preserved. To preserve the working directory, the working file system must be either already mounted on the host or be exported to it. Relative path names will only work if they are within the current file system; absolute path names may cause problems.\
Standard input is connected to standard input of the remote command, and standard output and standard error from the remote command are sent to the corresponding files for the on command.
w{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Interactive mode: use remote echoing and special character processing. This option is needed for programs that expect to be talking to a terminal. All terminal modes and window size changes are propagated
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 No Input: this option causes the remote program to get end-of-file when it reads from standard input, instead of passing standard input from the standard input of the on program. For example, -n is necessary when running commands in the background with job control.
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Debug mode: print out some messages as work is being done.
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The host to execute the command on
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The command to execute on host
argument
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The arguments to pass with command
\b0 executes command with low scheduling priority. If the number argument is present, the priority is incremented (higher numbers mean lower priorities) by that amount up to a limit of 20. The default number is 10. The super-user may run commands with priority higher than normal by using a negative priority, e.g. `--10'.
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 The priority is incremented (higher numbers mean lower priorities) by that amount up to a limit of 20
number
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The priority number
arguments
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The arguments of the command to be run
\b0 prints information about processes. Normally, only your processes are candidates to be printed by ps; specifying a causes other users' processes to be candidates to be printed; specifying x includes processes without control terminals in the candidate pool.\
All output formats include, for each process, the process id PID, control terminal of the process TT, cpu time used by the process TIME (this includes both user and system time), the state STAT of the process, and an indication of the COMMAND which is running. The state is given by a sequence of three letters, e.g. ``RWN''. The first letter indicates the runnability of the process: R for runnable processes, U for uninterruptible processes, S for those sleeping for less than about 20 seconds, I for idle (sleeping longer than about 20 seconds), T for stopped processes, H for halted processes, P for processes in page wait, and D for those in disk (or other short term) waits, processes. The second letter indicates whether a process is swapped out, showing W if it is, or a blank if it is loaded (in-core); a process which has specified a soft limit on memory requirements and which is exceeding that limit shows >; such a process is (necessarily) not swapped. The third letter indicates whether a process is running with altered CPU scheduling priority (nice); if the process priority is reduced, an N is shown, if the process priority has been artificially raised then a `<' is shown; processes running without special treatment have just a blank.\
A second argument is taken to be the file containing the system's namelist. Otherwise, /mach is used.\
Fields which are not common to all output formats: USER name of the owner of the process %CPU cpu utilization of the process; this is a decaying average over up to a minute of previous (real) time. Since the time base over which this is computed varies (since processes may be very young) it is possible for the sum of all %CPU fields to exceed 100%. NICE (or NI) process scheduling increment (see setpriority(2)) VSIZE virtual size of the process (in bytes) RSIZE real memory (resident set) size of the process (in bytes) LIM soft limit on memory used, specified via a call to setrlimit(2); if no limit has been specified then shown as xx TSIZ size of text (shared program) image TRS size of resident (real memory) set of text %MEM percentage of real memory used by this process. RE residency time of the process (seconds in core) SL sleep time of the process (seconds blocked) PAGEIN number of disk i/o's resulting from references by the process to pages not loaded in core. UID numerical user-id of process owner PPID numerical id of parent of process CP short-term cpu utilization factor (used in scheduling) PRI process priority (non-positive when in noninterruptible wait) ADDR swap address of the process WCHAN event on which process is waiting (an address in the system). A symbol is chosen that classifies the address, unless numerical output is requested (see the n flag). In this case, the initial part of the address is trimmed off and is printed hexadecimally, e.g., 0x80004000 prints as 4000.\
F flags associated with process as in <sys/proc.h>: SLOAD 00000001 in core SSYS 00000002 swapper or pager process SLOCK 00000004 process being swapped out SSWAP 00000008 save area flag STRC 00000010 process is being traced SWTED 00000020 another tracing flag SULOCK 00000040 user settable lock in core SPAGE 00000080 process in page wait state SKEEP 00000100 another flag to prevent swap out SOMASK 00000200 restore old mask after taking signal SWEXIT 00000400 working on exiting SPHYSIO 00000800 doing physical i/o SVFORK 00001000 process resulted from vfork() SVFDONE 00002000 another vfork flag SNOVM 00004000 no vm, parent in a vfork() SPAGI 00008000 init data space on demand from inode SSEQL 00010000 user warned of sequential vm behavior SUANOM 00020000 user warned of anomalous vm behavior STIMO 00040000 timing out during sleep SACTIVE 00080000 process is executing SOUSIG 00100000 using old signal mechanism SOWEUPC 00200000 owe process and addupc() call at next ast SSEL 00400000 selecting; wakeup/waiting danger SLOGIN 00800000 a login process (legitimate child of init) SLKDONE 20000000 record-locking has been done\
A process that has exited and has a parent that has not yet waited for the process is marked <defunct>; a process which is blocked trying to exit is marked <exiting>; Ps makes an educated guess as to the file name and arguments given when the process was created by examining memory or the swap area. The method is inherently somewhat unreliable and in any event a process is entitled to destroy this information, so the names cannot be counted on too much.
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Asks for information about all processes with terminals (ordinarily only one's own processes are displayed)
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Prints the command name, as stored internally in the system for purposes of accounting, rather than the command arguments, which are kept in the process' address space. This is more reliable, if less informative, since the process is free to destroy the latter information
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Asks for the environment to be printed as well as the arguments to the command
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Asks for all processes. Without this option, ps only prints ``interesting'' processes. Processes are deemed to be uninteresting if they are process group leaders. This normally eliminates top-level command interpreters and processes waiting for users to login on free terminals
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Asks for a long listing, with fields PPID, CP, PRI, NI, ADDR, SIZE, RSS and WCHAN as described below
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Prints out the threads corresponding to each task
V{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Asks for numerical output. In a long listing, the WCHAN field is printed numerically rather than symbolically, or, in a user listing, the USER field is replaced by a UID field
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Adds the size SSIZ of the kernel stack of each process (for use by system maintainers) to the basic output format
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Restricts output to processes whose controlling tty is x (which should be specified as printed by ps, e.g. t3 for tty3, co for console, da for ttyda, ? for proc*
esses with no tty, and ' a' or ' b' for ttya and ttyb respectively. This option must be the last one given
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The controlling tty
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 A user oriented output is produced. This includes fields USER, %CPU, NICE, SIZE, and RSS as described below
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 A version of the output containing virtual memory statistics is output. This includes fields RE, SL, PAGEIN, SIZE, RSS, LIM, TSIZ, TRS, %CPU and %MEM, described below. Because the NeXT computer is a Mach system (which doesn't necessarily record the same information as a UNIX 4.3BSD system) several of these fields will always be 0
V{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Use a wide output format (132 columns rather than 80); if repeated, e.g. ww, use arbitrarily wide output. This information is used to decide how much of long commands to print
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Asks even about processes with no terminal
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Is a flag retained for backwards compatibility. This flag does nothing on the NeXT system
2{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 A process number may be given, (indicated here by #), in which case the output is restricted to that process. This option must also be last
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The process number
namelist
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The system's namelist
\b0 is the server for the rexec(3X) routine. The server provides remote execution facilities with authentication based on user names and passwords.\
\b rexecd
\b0 listens for service requests at the port indicated in the ``exec'' service specification; see services(5). When a service request is received the following protocol is initiated:\
1) The server reads characters from the socket up to a null (`\\0') byte. The resultant string is interpreted as an ASCII number, base 10.\
2) If the number received in step 1 is non-zero, it is interpreted as the port number of a secondary stream to be used for the stderr. A second connection is then created to the specified port on the client's machine.\
3) A null terminated user name of at most 16 characters is retrieved on the initial socket.\
4) A null terminated, unencrypted password of at most 16 characters is retrieved on the initial socket.\
5) A null terminated command to be passed to a shell is retrieved on the initial socket. The length of the command is limited by the upper bound on the size of the system's argument list.\
6) Rexecd then validates the user as is done at login time and, if the authentication was successful, changes to the user's home directory, and establishes the user and group protections of the user. If any of these steps fail the connection is aborted with a diagnostic message returned.\
7) A null byte is returned on the initial socket and the command line is passed to the normal login shell of the user. The shell inherits the network connections established by rexecd.\
DIAGNOSTICS Except for the last one listed below, all diagnostic messages are returned on the initial socket, after which any network connections are closed. An error is indicated by a leading byte with a value of 1 (0 is returned in step 7 above upon successful completion of all the steps prior to the command execution).\
``username too long''\
The name is longer than 16 characters.\
``password too long''\
The password is longer than 16 characters.\
``command too long ''\
The command line passed exceeds the size of the argument list (as configured into the system).\
``Login incorrect.''\
No password file entry for the user name existed.\
``Password incorrect.''\
The wrong was password supplied.\
``No remote directory.''\
The chdir command to the home directory failed.\
``Try again.''\
A fork by the server failed.\
``<shellname>: ...''\
The user's login shell could not be started. This message is returned on the connection associated with the stderr, and is not preceded by a flag byte.
\b0 is the RPC server for remote program execution. This daemon is started by inetd(8) whenever a remote execution request is made, if the following line is placed in /etc/inetd.conf:\
For non-interactive programs standard file descriptors are connected directly to TCP connections. Interactive programs involve pseudo-terminals, similar to the login sessions provided by rlogin(1) . This daemon may use the NFS to mount file systems specified in the remote execution request.
\b0 connects to the specified host, and executes the specified command. Rsh copies its standard input to the remote command, the standard output of the remote command to its standard output, and the standard error of the remote command to its standard error. Interrupt, quit and terminate signals are propagated to the remote command; rsh normally terminates when the remote command does.\
The remote username used is the same as your local username, unless you specify a different remote name with the -l option. This remote name must be equivalent (in the sense of rlogin(1C)) to the originating account; no provision is made for specifying a password with a command.\
If you omit command, then instead of executing a single command, you will be logged in on the remote host using rlogin(1C).\
Shell metacharacters which are not quoted are interpreted on local machine, while quoted metacharacters are interpreted on the remote machine. Thus the command\
\b rsh otherhost cat remotefile >> localfile\
\b0 \
appends the remote file remotefile to the localfile localfile, while\
Host names are given in netinfo(5) if NetInfo is running or in the file /etc/hosts if NetInfo is not running. Each host has one standard name (the first name given in the file), which is rather long and unambiguous, and optionally one or more nicknames. The host names for local machines are also commands in the directory /usr/hosts; if you put this directory in your search path then the rsh can be omitted.
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Used to specify a different remote username
username
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The remote username desired
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Redirects the input of rsh to /dev/null
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The command to execute remotely
\b0 is the server for the rcmd(3X) routine and, consequently, for the rsh(1C) program. The server provides remote execution facilities with authentication based on privileged port numbers from trusted hosts.\
\b rshd
\b0 listens for service requests at the port indicated in the ``cmd'' service specification; see services(5). When a service request is received the following protocol is initiated:\
1) The server checks the client's source port. If the port is not in the range 0-1023, the server aborts the connection.\
2) The server reads characters from the socket up to a null (`\\0') byte. The resultant string is interpreted as an ASCII number, base 10.\
3) If the number received in step 1 is non-zero, it is interpreted as the port number of a secondary stream to be used for the stderr. A second connection is then created to the specified port on the client's machine. The source port of this second connection is also in the range 0-1023.\
4) The server checks the client's source address and requests the corresponding host name (see gethostbyaddr(3N), hosts(5) and named(8)). If the hostname cannot be determined, the dot-notation representation of the host address is used.\
5) A null terminated user name of at most 16 characters is retrieved on the initial socket. This user name is interpreted as the user identity on the client's machine.\
6) A null terminated user name of at most 16 characters is retrieved on the initial socket. This user name is interpreted as a user identity to use on the server's machine.\
7) A null terminated command to be passed to a shell is retrieved on the initial socket. The length of the command is limited by the upper bound on the size of the system's argument list.\
8) Rshd then validates the user according to the following steps. The local (server-end) user name is looked up in the password file and a chdir is performed to the user's home directory. If either the lookup or chdir fail, the connection is terminated. If the user is not the super-user, (user id 0), the file /etc/hosts.equiv is consulted for a list of hosts considered ``equivalent''. If the client's host name is present in this file, the authentication is considered successful. If the lookup fails, or the user is the superuser, then the file .rhosts in the home directory of the remote user is checked for the machine name and identity of the user on the client's machine. If this file is owned by someone other than the user or root, or is writeable by anyone but the owner then then lookup will fail. If this lookup fails, the connection is terminated.\
9) A null byte is returned on the initial socket and the command line is passed to the normal login shell of the user. The shell inherits the network connections established by rshd.\
DIAGNOSTICS Except for the last one listed below, all diagnostic messages are returned on the initial socket, after which any network connections are closed. An error is indicated by a leading byte with a value of 1 (0 is returned in step 9 above upon successful completion of all the steps prior to the execution of the login shell).\
``locuser too long''\
The name of the user on the client's machine is longer than 16 characters.\
``remuser too long''\
The name of the user on the remote machine is longer than 16 characters.\
``command too long ''\
The command line passed exceeds the size of the argument list (as configured into the system).\
``Login incorrect.''\
No password file entry for the user name existed.\
``No remote directory.''\
The chdir command to the home directory failed.\
``Permission denied.''\
The authentication procedure described above failed.\
``Can't make pipe.''\
The pipe needed for the stderr, wasn't created.\
``Try again.''\
A fork by the server failed.\
``<shellname>: ...'' The user's login shell could not be started. This message is returned on the connection associated with the stderr, and is not preceded by a flag byte.
\b0 reads and logs messages into a set of files described by the configuration file /etc/syslog.conf. Each message is one line. A message can contain a priority code, marked by a number in angle braces at the beginning of the line. Priorities are defined in <sys/syslog.h>. Syslogd reads from the UNIX domain socket /dev/log, from an Internet domain socket specified in /etc/services, and from the special device /dev/klog (to read kernel messages).\
\b syslogd
\b0 configures when it starts up and whenever it receives a hangup signal. Lines in the configuration file have a selector to determine the message priorities to which the line applies and an action. The action field are separated from the selector by one or more tabs.\
Selectors are semicolon separated lists of priority specifiers. Each priority has a facility describing the part of the system that generated the message, a dot, and a level indicating the severity of the message. Symbolic names may be used. An asterisk selects all facilities. All messages of the specified level or higher (greater severity) are selected. More than one facility may be selected using commas to separate them. For example:\
\b *.emerg;mail,daemon.crit
\b0 \
Selects all facilities at the emerg level and the mail and daemon facilities at the crit level.\
Known facilities and levels recognized by syslogd are those listed in syslog(3) without the leading ``LOG_''. The additional facility ``mark'' has a message at priority LOG_INFO sent to it every 20 minutes (this may be changed with the -m flag). The ``mark'' facility is not enabled by a facility field containing an asterisk. The level ``none'' may be used to disable a particular facility. For example,\
\b *.debug;mail.none
\b0 \
Sends all messages except mail messages to the selected file.\
The second part of each line describes where the message is to be logged if this line is selected. There are four forms:\
+ A filename (beginning with a leading slash). The file will be opened in append mode.\
+ A hostname preceded by an at sign (``@''). Selected messages are forwarded to the syslogd on the named host.\
+ A comma separated list of users. Selected messages are written to those users if they are logged in.\
+ An asterisk. Selected messages are written to all logged-in users.\
Blank lines and lines beginning with `#' are ignored.\
logs all kernel messages and 20 minute marks onto the system console, all notice (or higher) level messages and all mail system messages except debug messages into the file /usr/spool/adm/syslog, and all critical messages into /usr/adm/critical; kernel messages of error severity or higher are forwarded to ucbarpa. All users will be informed of any emergency messages, the users ``eric'' and ``kridle'' will be informed of any alert messages, and the user ``ralph'' will be informed of any alert message, or any warning message (or higher) from the authorization system.\
\b syslogd
\b0 creates the file /etc/syslog.pid, if possible, containing a single line with its process id. This can be used to kill or reconfigure syslogd.\
To bring
\b syslogd
\b0 down, it should be sent a terminate signal (e.g. kill `cat /etc/syslog.pid`).
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Specify an alternate configuration file
configfile
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The alternate configuration file
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Select the number of minutes between mark messages
markinterval
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The number of minutes between mark messages
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Turn on debugging
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b\i0\ulnone\fs24\fc0\cf0 tee
\b0 transcribes the standard input to the standard output and makes copies in the files.
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Causes tee to ignore interrupts
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Causes the output to be appended to the files rather than overwriting them
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The files to make copies in
\b0 displays Mach virtual memory statistics. If the optional interval is specified, then vm_stat will display the statistics every interval seconds. In this case, each line of output displays the change in each statistic (an interval count of 1 displays the values per second). However, the first line of output following each banner displays the system-wide totals for each statistic. The following values are displayed: Pages free the total number of free pages in the system. Pages active the total number of pages currently in use and pageable. Pages inactive the total number of pages on the inactive list. Pages wired down the total number of pages wired down. That is, pages that cannot be paged out. Translation faults the number of times the "vm_fault" routine has been called. Pages copy-on-write the number of faults that caused a page to be copied (generally caused by copy-on-write faults). Pages zero filled the total number of pages that have been zero-filled on demand. Pages reactivated the total number of pages that have been moved from the inactive list to the active list (reactivated). Pageins the number of requests for pages from a pager (such as the inode pager). Pageouts the number of pages that have been paged out. If interval is not specified, then vm_stat displays all accumulated statistics along with the page size and the object cache performance.
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The number of seconds to delay between statistics displays
\b0 combines the fixed initial-arguments with arguments read from standard input, to execute the specified command one or more times. The number of arguments read for each command invocation, and the manner in which they are combined are determined by the options specified.\
command, which may be a shell file, is searched for using one's $PATH. If command is omitted, /bin/echo is used.\
Arguments read in from standard input are defined to be contiguous strings of characters delimited by white space. Empty lines are always discarded. Blanks and tabs may be embedded as part of an argument if they are escaped or quoted. Characters enclosed in quotes (single or double) are taken literally, and the delimiting quotes are removed. Outside of quoted strings, a backslash (\\) will escape the character it precedes.\
Each arguments-list is constructed starting with the initial-arguments, followed by some number of arguments read from standard input (Exception: see -i option). Options -i, -l, and -n determine how arguments are selected for each command invocation. When none of these options are coded, the initial-arguments are followed by arguments read continuously from standard input until an internal buffer is full, and then command is executed with the accumulated arguments. This process is repeated until there are none left. When there are option conflicts (e.g., -l vs. -n), the last option takes precedence.\
\b xargs
\b0 will terminate if it receives a return code of -1, or if it cannot execute command. When command is a shell script, it should explicitly exit (see sh(1)) with an appropriate value to avoid accidentally returning with -1.\
EXAMPLES\
The following will move all files from directory $1 to directory $2, and echo each move command just before doing it:\
\b ls $1 | xargs -i -t mv $1/\{\} $2/\{\}\
\b0 \
The following will combine the output of the parenthesized commands onto one line, which is then echoed to the end of file log:\
\b (logname; date; echo $0 $*) | xargs >>log\
\b0 \
The user is asked which files in the current directory are to be archived and archives them into arch (1.) one at a time, or (2.) many at a time.\
\b 1. ls | xargs -p -l ar r arch\
2. ls | xargs -p -l | xargs ar r arch\
\b0 \
The following will execute diff(1) with successive pairs of arguments originally typed as shell arguments:\
\b echo $* | xargs -n2 diff
R{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Command is executed for each nonempty number lines of arguments from standard input. The last invocation of command will be with fewer lines of arguments if fewer than number remain. A line is considered to end with the first new-line unless the last character of the line is a blank or a tab; a trailing blank/tab signals continuation through the next non-empty line. If number is omitted, 1 is assumed. Option -x is forced
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The number of nonempty lines
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Insert mode: command is executed for each line from standard input, taking the entire line as a single arg, inserting it in initial-arguments for each occurrence of replstr. A maximum of 5 arguments in initial-arguments may each contain one or more instances of replstr. Blanks and tabs at the beginning of each line are thrown away. Constructed arguments may not grow larger than 255 characters, and option -x is also forced. \{\} is assumed for replstr if not specified
replstr
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The string to replace
"{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Execute command using as many standard input arguments as possible, up to number arguments maximum. Fewer arguments will be used if their total size is greater than size characters, and for the last invocation if there are fewer than number arguments remaining. If option -x is also coded, each number arguments must fit in the size limitation, else xargs terminates execution
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The maximum number of arguments
"{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Trace mode: The command and each constructed argument list are echoed to file descriptor 2 just prior to their execution
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Prompt mode: The user is asked whether to execute command each invocation. Trace mode (-t) is turned on to print the command instance to be executed, followed by a ?... prompt. A reply of y (optionally followed by anything) will execute the command; anything else, including just a carriage return, skips that particular invocation of command
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Causes xargs to terminate if any argument list would be greater than size characters; -x is forced by the options -i and -l. When neither of the options -i, -l, or -n are coded, the total length of all arguments must be within the size limit
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 The maximum total size of each argument list is set to size characters; size must be a positive integer less than or equal to 470. If -s is not coded, 470 is taken as the default. Note that the character count for size includes one extra character for each argument and the count of characters in the command name
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The number of characters
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 eofstr is taken as the logical end-of-file string. Underbar (_) is assumed for the logical EOF string if -e is not coded. The value -e with no eofstr coded turns off the logical EOF string capability (underbar is taken literally). xargs reads standard input until either end-of-file or the logical EOF string is encountered
eofstr
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The logical end-of-file string
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The command to invoke
initial-arguments
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The initial argument to the invoked command